#pragma once

#include "../Core/Vector.h"
#include "DrawAutomaticUniform.h"
#include "Uniform.h"
#include "Context.h"
#include "DrawCommand.h"
#include "SceneState.h"

using namespace Core;

namespace Renderer
{
	class Wgs84HeightUniform : public DrawAutomaticUniform
	{
	public:
		Wgs84HeightUniform(Uniform* uniform)
		{
			_uniform = (TemplateUniform<float>*)uniform;
		}

		void Set(Context* context, DrawCommand* drawCommand, SceneState* sceneState)
		{
			//
			// viewport.Bottom should really be used but Rectangle goes top to botom, not bottom to top.
			//
			Rectangle viewport = context->GetViewport();
			_uniform->SetValue((float)(sceneState->GetCamera()->Height(Ellipsoid::Wgs84)));

		}

	private:
		TemplateUniform<float>* _uniform;
	};
}